home *** CD-ROM | disk | FTP | other *** search
- Path: tank.news.pipex.net!pipex!iol!usenet
- From: Roy Leonard <rleonard@ferrotec.ie>
- Newsgroups: comp.lang.c
- Subject: (no subject)
- Date: 27 Feb 1996 14:25:39 GMT
- Organization: Ferrotec Ltd
- Message-ID: <4gv493$p09@nuacht.iol.ie>
- NNTP-Posting-Host: ferrotec.iol.ie
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
-
-
- Hi all,
-
- I have a strange problem from an embedded system. I have an array of
- data, and
- I want to count all the high bits (=1) in the array.
-
- Hopefully there is a way I can do this in C at high speed. The
- alternative is assembler, which I would prefer not to do, but I may have
- to. Does anyone have any nifty ideas about how I might go about this?
-
-
- The data is of fixed length (roughly 50 long ints). Each bit is evenly
- weighted.
- Eg.
-
- If the data in binary was "1001001", the total I'm looking for is three.
-
-
-
- Looking forward to some interesting responses!
-
- Roy
- --
- -==-
- Roy Leonard
- leonardr@iol.ie
- Development Engineer
-
- "Stress is when your mouth says 'No Problem' and your gut says 'NO WAY'"
- -==-
-
-
-